/*
 * @Author: Yang Zhang
 * @Date: 2021-12-02 23:18:44
 * @LastEditors: Yang Zhang
 * @LastEditTime: 2021-12-07 23:04:00
 * @Description: 
 */
import { request } from "../utils/request";
import { IStoreinfo, IOverview } from "./types";

const api = {
  improveStoreinfo: '/store/seller/perfect',
  mainRecommend: '/store/goods/mainRecommend',
  recommendPro: '/store/goods/recommend',
  overview: '/store/statistics/order/getKOLOverview',
  homeData: '/store/statistics/order/homeData'
}

/**
 * @description 完善店铺信息
 */
export const updateStoreInfo = (data: IStoreinfo) => {
  return request({
    url: api.improveStoreinfo,
    method: 'post',
    data,
    formData: true
  })
}

/**
 * @description 获取轮播图数据
 */
export const getMainBanners = () => {
  return request({
    url: api.mainRecommend,
    method: 'get'
  })
}

/**
 * @description 获取推荐商品列表
 */
export const getRecproducts = () => {
  return request({
    url: api.recommendPro,
    method: 'get'
  })
}

/**
 * @description:获取首页订单概览统计
 */
export const getIndexover = (data: IOverview) => {
  return request({
    url: api.overview,
    method: 'get',
    params: data
  })
}

// 首页数据信息
export const getHomedata = () => {
  return request({
    url: api.homeData,
    method: 'get',
  })
}